#!/usr/bin/python
# -*- coding: utf-8 -*-
"""all about encrypt
"""

from string import ascii_letters

letters = {}
for i, c in enumerate(ascii_letters):
    letters[c] = i

def caesar_encrypt(s, k=1):
    """very old encrypt method
    
    wiki: http://en.wikipedia.org/wiki/Caesar_cipher
    """
    e_s = []
    for c in s:
        if c in ascii_letters:
            i = letters[c] + k
            i = i % len(ascii_letters)
            c = ascii_letters[i]
        e_s.append(c)
    return ''.join(e_s)

def caesar_decrypt(s, k=1):
    """very old encrypt method
    
    wiki: http://en.wikipedia.org/wiki/Caesar_cipher
    """
    e_s = []
    for c in s:
        if c in ascii_letters:
            i = letters[c] - k
            i = i % len(ascii_letters)
            c = ascii_letters[i]
        e_s.append(c)
    return ''.join(e_s)